#include "main.h"

#include "driverlib/ssi.h"
#include "inc/hw_ssi.h"

/*

SSI0Clk 19 PA2 (2) I/O TTL SSI module 0 clock
SSI0Fss 20 PA3 (2) I/O TTL SSI module 0 frame signal
SSI0Rx  21 PA4 (2) I TTL SSI module 0 receive
SSI0Tx  22 PA5 (2) O TTL SSI module 0 transmit


*/
void Lessing_init_spi()
{
    SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI0);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
    GPIOPinTypeSSI(GPIO_PORTA_BASE, GPIO_PIN_2 | GPIO_PIN_3 | GPIO_PIN_4 | GPIO_PIN_5);
    SSIConfigSetExpClk(SSI0_BASE, SysCtlClockGet(), SSI_FRF_MOTO_MODE_0,
                       SSI_MODE_MASTER, 10000000, 8); // 10MHz
    
    SSIEnable(SSI0_BASE);
    // SSIDataGet()
    
}